package com.matt.domain.roleJob;

import com.matt.commons.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;


@Data
@Entity
@Table(name = "tb_role_job_finish")
@EqualsAndHashCode(callSuper = true)
public class RoleJobFinish extends Model {

    @Column(columnDefinition = " datetime DEFAULT NOW() COMMENT '创建时间' ")
    private Date finishTime = new Date();

    @Column(columnDefinition = " varchar(64) COMMENT '员工ID' ")
    private String staffId;

    @Column(columnDefinition = " int  COMMENT '任务经验' ")
    private Integer expValue ;

    @Column(columnDefinition = " varchar(64) COMMENT '任务id' ")
    private String jobId = "";

    @Column(columnDefinition = " varchar(50) COMMENT '角色ocde' ")
    private String roleCode;
        /**
        ROLE_NURSE	保育员
        ROLE_GARDEN_LEADER	园长
        ROLE_DOCTOR	儿保医生
        ROLE_TEACHER	老师
        ROLE_BUSINESS	销售
        **/

        public static RoleJobFinish of(Date finishTime, String staffId, int expValue, String jobId,String roleCode) {
            RoleJobFinish finish = new RoleJobFinish();
            finish.setFinishTime(finishTime);
            finish.setStaffId(staffId);
            finish.setExpValue(expValue);
            finish.setJobId(jobId);
            finish.setRoleCode(roleCode);
            return finish;
        }
}
